<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./template.xhtml">

            <ui:define name="title">
                Instruster Home Page
            </ui:define>

            <ui:define name="content">
                <h:form prependId="false">
                    <p:dataTable var="t" value="#{timeTableOfUserBean.times}" id="datatable" rows="20" resizableColumns="false">
                        <f:facet name="header">
                            List TimeTable Of You
                        </f:facet>
                        <p:column headerText="Lab Name">
                            <h:link outcome="timeTableDetail" value="#{t.labID.labname}">
                                <f:param name="timeid" value="#{t.id}" />
                            </h:link>
                        </p:column>
                        <p:column headerText="Username">
                            <h:link outcome="timeTableDetail" value="#{t.userID.username}">
                                <f:param name="timeid" value="#{t.id}" />
                            </h:link>
                        </p:column>
                        <p:column headerText="Start Time">
                            <h:link outcome="timeTableDetail">
                                <h:outputText value="#{t.startTime}" >
                                    <f:convertDateTime pattern="HH:mm a" timeZone="GMT+7" />
                                </h:outputText>
                                <f:param name="timeid" value="#{t.id}" />
                            </h:link>
                        </p:column>
                        <p:column headerText="End Time">
                            <h:link outcome="timeTableDetail">
                                <h:outputText value="#{t.endTime}" >
                                    <f:convertDateTime pattern="HH:mm a" timeZone="GMT+7" />
                                </h:outputText>
                                <f:param name="timeid" value="#{t.id}" />
                            </h:link>
                        </p:column>
                        <p:column headerText="Description">
                            <h:link outcome="timeTableDetail" value="#{t.description}">
                                <f:param name="timeid" value="#{t.id}" />
                            </h:link>
                        </p:column>
                    </p:dataTable>
                    <!--                    <h:commandButton value="Excel">
                                            <p:dataExporter type="xls" target="datatable" fileName="timetable" />
                                        </h:commandButton>-->
                </h:form>
            </ui:define>
        </ui:composition>

    </body>
</html>
